Data Structure
Q191.
Consider a singly linked list of the form where F is a pointer to the first element in the linked list and L is the pointer to the last element in the list. The time of which of the following operations depends on the length of the list?Q192.
N items are stored in a sorted doubly linked list. For a delete operation, a pointer is provided to the record to be deleted. For a decrease-key operation, a pointer is provided to the record on which the operation is to be performed. An algorithm performs the following operations on the list in this order: \Theta(N) \; delete , O(logN) \; insert , O(logN) \; find , and \Theta(N) \; decrease-key. What is the time complexity of all these operations put together?Q193.
In a doubly linked list the number of pointers affected for an insertion operation will beQ195.
Which of the following operations is performed more efficiently by doubly linked list than by linear linked list?Q196.
Given two statementsInsertion of an element should be done at the last node of the circular listDeletion of an element should be done at the last node of the circular listQ197.
The following C function takes a simply-linked list as input argument. It modifies the list by moving the last element to the front of the list and returns the modified list. Some part of the code is left blank. typedef struct node { int value; struct node *next; } Node; Node *move_to_front(Node *head) { Node *p, *q; if ((head = = NULL: || (head->next = = NULL)) return head; q = NULL; p = head; while (p-> next !=NULL) { q=P; p=p->next; } _______________________________ return head; } Choose the correct alternative to replace the blank line.Q198.
An unordered list contains n distinct elements. The number of comparisons to find an element in this list that is neither maximum nor minimum isQ199.
The following steps in a linked list p = getnode() info(p) = 10 next (p) = list list = p result in which type of operation?Q200.
Consider a single linked list where F and L are pointers to the first and last elements respectively of the linked list. The time for performing which of the given operations depends on the length of the linked list?